import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/openleayers",
  },
  {
    path: "/mapbox",
    name: "mapbox",
    component: () =>
      import(/* webpackChunkName: "about" */ "../components/geowapian.vue"),
  },
  {
    path: "/siji",
    name: "siji",
    component: () =>
      import(/* webpackChunkName: "about" */ "../components/siji.vue"),
  },
  {
    path: "/openleayers",
    name: "openleayers",
    component: () =>
      import(/* webpackChunkName: "about" */ "../components/openleayers.vue"),
  },
  {
    path: "/cesium",
    name: "cesium",
    component: () =>
      import(/* webpackChunkName: "about" */ "../components/cesium.vue"),
  },
  {
    path: "/mapbox1",
    name: "mapbox1",
    component: () =>
      import(/* webpackChunkName: "about" */ "../components/mapbox.vue"),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});
const routerPush = VueRouter.prototype.push;
VueRouter.prototype.push = function (location) {
  return routerPush.call(this, location).catch((err) => {});
};

export default router;
